<%--
  Created by IntelliJ IDEA.
  User: tangchunyu
  Date: 2021/9/20
  Time: 15:34
  To change this template use File | Settings | File Templates.
--%>
<<%--
  Created by IntelliJ IDEA.
  User: Sp
  Date: 2021/9/20
  Time: 12:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<script type="text/javascript">
    function del(id) {
        var msg = "您真的确定要删除吗？\n\n请确认！";
        if (confirm(msg) == true) {
            location.href="/address/del?id="+id
        } else {
            return false;
        }
    } </script>
<body>
<table border="1">
    <tr>
        <th>序号</th>
        <th>姓名</th>
        <th>手机</th>
        <th>住址</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${addlist}" var="add" varStatus="i">
        <tr>
            <td>${i.index}</td>
            <td>${add.name}</td>
            <td>${add.phone}</td>
            <td>${add.detail}</td>
            <td><a href="/address/update?id=${add.id}">编辑</a>
                <a href="/address/delete?id=${add.id}">删除</a>
                    <%--               <button onclick="delete(${add.id})" >删除</button>--%>
            </td>
        </tr>
    </c:forEach>
</table>
<a href="/index.jsp">返回首页</a>
</body>
</html>
Sp 15:33:48
<%--
  Created by IntelliJ IDEA.
  User: Sp
  Date: 2021/9/20
  Time: 12:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<script type="text/javascript">
    function del(id) {
        var msg = "您真的确定要删除吗？\n\n请确认！";
        if (confirm(msg) == true) {
            location.href="/address/del?id="+id
        } else {
            return false;
        }
    } </script>
<body>
<table border="1">
    <tr>
        <th>序号</th>
        <th>姓名</th>
        <th>手机</th>
        <th>住址</th>
        <th>操作</th>
    </tr>
    <c:forEach items="${addlist}" var="add" varStatus="i">
        <tr>
            <td>${i.index}</td>
            <td>${add.name}</td>
            <td>${add.phone}</td>
            <td>${add.detail}</td>
            <td><a href="/address/update?id=${add.id}">编辑</a>
                <a href="/address/delete?id=${add.id}">删除</a>
                    <%--               <button onclick="delete(${add.id})" >删除</button>--%>
            </td>
        </tr>
    </c:forEach>
</table>
<a href="/index.jsp">返回首页</a>
</body>
</html>
